package br.com.ep.festa.controller;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import org.primefaces.context.RequestContext;

@ManagedBean(name = "viewBean")
@SessionScoped
public class ViewBean {

	private String urlWindow = "estado.xhtml";

	private String modalWindow = "";

	

	public String getUrlWindow() {
		return urlWindow;
	}

	public void setUrlWindow(String urlWindow) {
		this.urlWindow = urlWindow;
	}

	public String getModalWindow() {
		return modalWindow;
	}

	public void setModalWindow(String modalWindow) {
		this.modalWindow = modalWindow;
		
		if(this.modalWindow != null && this.modalWindow.trim().length()>0){
			//abrir modal
			RequestContext.getCurrentInstance().execute("modalDialog.show()");
		}
		else{//esconda modal
			RequestContext.getCurrentInstance().execute("modalDialog.hide()");
		}
	}

	
	
	
}
